package com.slixils.demo.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.slixils.demo.pojo.entity.Order;
import com.slixils.demo.pojo.entity.User;
import com.slixils.demo.vo.GoodsVo;
import com.slixils.demo.vo.OrderDeatilVo;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author Helen
 * @since 2022-04-05
 */
public interface OrderService extends IService<Order> {
    /**
     * 秒杀
     *
     * @param user    用户对象
     * @param goodsVo 商品对象
     * @return com.example.seckilldemo.entity.TOrder
     * @author LC
     * @operation add
     * @date 1:44 下午 2022/3/4
     **/
    Order secKill(User user, GoodsVo goodsVo);

    /**
     * 订单详情方法
     *
     * @param orderId
     * @return com.example.seckilldemo.vo.OrderDeatilVo
     * @author LC
     * @operation add
     * @date 10:21 下午 2022/3/6
     **/
    OrderDeatilVo detail(Long orderId);

    /**
     * 获取秒杀地址
     *
     * @param user
     * @param goodsId
     * @return java.lang.String
     * @author LiChao
     * @operation add
     * @date 2:59 下午 2022/3/9
     **/
    String createPath(User user, Long goodsId);

    /**
     * 校验秒杀地址
     *
     * @param user
     * @param goodsId
     * @param path
     * @return boolean
     * @author LiChao
     * @operation add
     * @date 2:59 下午 2022/3/9
     **/
    boolean checkPath(User user, Long goodsId, String path);

    /**
     * 校验验证码
     * @author LiChao
     * @operation add
     * @date 3:52 下午 2022/3/9
     * @param tuser
     * @param goodsId
     * @param captcha
     * @return boolean
     **/
    boolean checkCaptcha(User tuser, Long goodsId, String captcha);
}
